from selenium.webdriver.common.by import By


class AdminDataDeletionCreAscmDataLocator:
    # CRE Data 菜单
    cre_data_menu = (By.CSS_SELECTOR, '[path="/console/singleCreData"]')
    # CRE&ASCM Data菜单
    cre_ascm_data_menu = (By.CSS_SELECTOR, '[path="/console/creData"]')
    # ASCM Data tab
    ascm_data_tab = (By.CSS_SELECTOR, "[path='/console/ascmData']")
    # Document一级tab
    document_tab = (By.XPATH, "//div[text()='Document']/..")
    # Document Center tab
    document_center_tab = (By.CSS_SELECTOR, "[path='/console/documentApi/portal']")
    # 无菜单权限的报错页面
    no_permission = (By.XPATH, '//h1[text() = "403"]')


    # CRE$ASCM Data 列表字段
    list_columns = (By.XPATH, "//tr//th[not(contains(@class, 'antd4-table-selection-column'))]")
    # status、Payment Mode、Account Type字段展开后的选项
    list_columns_items = (By.XPATH, "//li[@class='antd4-dropdown-menu-item']")
    # actions字段按钮
    list_actions_items = (By.XPATH, "//button[contains(@class, 'antd4-btn-link table-operation-btnLine-btn')]")
    # 列表数据行
    list_data_rows = (By.XPATH, "//tr[@class='antd4-table-row antd4-table-row-level-0']")
    # 可点击的log按钮
    list_active_log = (By.XPATH, "//button[not(@disabled)]/span[text()='Log']/..")
    # 筛选器按钮
    list_filters = (By.XPATH, "//span[contains(@class, 'antd4-table-filter-trigger')]")
    list_filter1 = (By.XPATH, "(//span[contains(@class, 'antd4-table-filter-trigger')])[1]")
    list_filter2 = (By.XPATH, "(//span[contains(@class, 'antd4-table-filter-trigger')])[2]")
    list_filter3 = (By.XPATH, "(//span[contains(@class, 'antd4-table-filter-trigger')])[3]")
    # 筛选器选项
    list_filter_options = (By.XPATH, "//li[contains(@class, 'antd4-dropdown-menu-item')]")
    # 被勾选的筛选器选项
    list_filter_options_selected = (By.XPATH, "//li[contains(@class, 'antd4-dropdown-menu-item-selected')]")
    # 筛选器OK按钮
    list_filter_confirm = (By.XPATH, "//span[text()='OK']/..")
    # 筛选器reset按钮
    list_filter_reset = (By.XPATH, "//div[@class='antd4-table-filter-dropdown-btns']//span[text()='Reset']/..")
    # 批量操作按钮
    list_bitch_buttons = (By.XPATH, "(//div[contains(@class, 'antd4-space-horizontal')])[4]//button")
    # 列表滚动条（包含log抽屉的列表）
    list_scroll = (By.XPATH, "//div[contains(@class, 'antd4-table-scroll-horizontal')]")


    # 问号提示图标
    prompt_icon_question_mark = (By.XPATH, "//span[@class='anticon anticon-question-circle']")
    # 问号提示语
    prompt_question_mark = (By.XPATH, "//div[@class='antd4-popover-inner-content']/div")
    # 叹号提示语
    prompt_exclamation_mark= (By.XPATH, "//div[@class='antd4-alert-message']/div")

    # 下载模板按钮
    template_download = (By.XPATH, "//div[@class='antd4-alert-message']//button")
    # 导入文件按钮
    import_file_button = (By.XPATH, "//span[text()='Import Data']/..")
    # 导入文件按钮（disable）
    import_file_button_disabled = (By.XPATH, "//span[text()='Import Data']/..")
    # 文件导入直接给此元素send key
    import_file = (By.XPATH, "//input[@type='file']")

    # 气泡提示框
    pup_success = (By.XPATH, "//div[contains(@class,'antd4-message-success')]/span[not(@class)]")
    # 告警气泡提示
    pup_notice = (By.XPATH, "//div[@class='antd4-message-notice-content']")
    # 导入按钮下面的文字提示
    message_text = (By.XPATH, "//div[@class='message-text']/div")


    # 查询条件下拉选择框
    query_selector = (By.XPATH, "//div[@class='antd4-select antd4-select-single antd4-select-show-arrow']/div[@class='antd4-select-selector']")
    # 查询类型选项
    query_options = (By.XPATH, "//div[@class='antd4-select-item-option-content']")
    # 关键词输入框
    query_input = (By.XPATH, "//input[@class='antd4-input']")
    # 查询按钮
    query_search_button = (By.XPATH, "//span[text()='Search']/..")
    # 重置按钮
    query_reset_button = (By.XPATH, "//span[text()='Reset']/..")


    # 抽屉title
    drawer_title = (By.CSS_SELECTOR, "div.antd4-drawer-title")
    # 抽屉Operational Informati表格
    drawer_oi_table = (By.XPATH, "//div[text()='Operational Information']/following-sibling::div[1]//th")
    # 抽屉Operational Informati表格
    drawer_ddd_table = (By.XPATH, "//div[text()='Data Deletion Detail']/following-sibling::div[1]//th")
    # 抽屉tabs
    drawer_tabs = (By.XPATH, "//div[contains(@class,'antd4-tabs-tab-btn')]")

    # log basic info 内容
    log_bi_items = (By.XPATH, "//div[@class='antd4-descriptions-item-container']/span[@class='antd4-descriptions-item-content']")
    log_detail_oi_operation_num = (
    By.XPATH, "//div[contains(@class,'antd4-table antd4-table-scroll-horizontal')]/../ul/li")
    log_detail_ddd_operation_num = (
    By.XPATH, "//div[contains(@class,'antd4-table antd4-table-ping-right antd4-table-scroll-horizontal')]/../ul/li")
    log_detail_ascm_ddd_pagin = (By.XPATH, "(//div[contains(@class,'antd4-table') and  contains(@class, ' antd4-table-scroll-horizonta')])[5]/../ul/li")


    # ======================================== document center locator ==============================================
    # loading anime
    document_center_loading_anime = (By.XPATH, "//span[@class='antd4-spin-dot antd4-spin-dot-spin']")
    # iframe
    document_center_frame = (By.XPATH, "//iframe")

    # query input
    document_center_query_input = (By.XPATH, "//input[@id='search_input_react' and @placeholder='search']")

    # query associate item
    document_center_query_associate_item = (By.XPATH, "//div[@class='algolia-docsearch-suggestion--title']")

